package com.yunban.project.api.text_check.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.Fastjson2TypeHandler;
import com.yunban.project.api.text_check.enums.CorrectState;
import com.yunban.project.api.text_check.utils.TextCorrectionMatchResp;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import net.lab1024.sa.base.ProjectConstants;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author: lijiajun
 * @date: 2024-12-04
 * @version: 1.0
 */
@Data
@Schema(description = "文本纠错任务详情")
@TableName(value = ProjectConstants.TEXT_TABLE_PREFIX + "correct_task_details", autoResultMap = true)
public class CorrectTaskDetails implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Long id;
    private String taskId;
    private int sort;
    private String sentence;
    private int startIndex;
    private int endIndex;
    @TableField(typeHandler = Fastjson2TypeHandler.class)
    private List<TextCorrectionMatchResp> result;
    @Version
    private int version;
    private CorrectState state = CorrectState.UNKNOWN;
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;
}